{template '../header'}
{template '../left'}

<?php
function _SERVER($n) { return isset($_SERVER[$n]) ? $_SERVER[$n] : '[undefine]'; }
?>

<div class="card">
    <div class="card-header">
        后台首页
    </div>
    <div class="card-body">
        <table class="table table-striped">
            <tr>
                <td colspan="6" style="text-align: center; font-weight: bold;">服务器信息</td>
            </tr>
            <tr>
                <td colspan="3">服务器域名</td>
                <td colspan="3"><?=_SERVER('SERVER_NAME')?></td>
            </tr>
            <tr>
                <td colspan="3">服务器环境</td>
                <td colspan="3"><?=stripos(_SERVER('SERVER_SOFTWARE'), 'PHP')?_SERVER('SERVER_SOFTWARE'):_SERVER('SERVER_SOFTWARE')?></td>
            </tr>
            <tr>
                <td colspan="3">PHP运行环境</td>
                <td colspan="3"><?=PHP_SAPI .' PHP/'.PHP_VERSION?></td>
            </tr>
            <tr>
                <td colspan="3">服务器标准时</td>
                <td colspan="3">
                    <?=gmdate('Y-m-d H:i:s', time() + 3600 * 8)?>
                </td>
            </tr>
            <tr>
                <td colspan="6" style="text-align: center; font-weight: bold;">运行参数</td>
            </tr>
            <tr>
                <td>Memory限制</td>
                <td>Upload限制</td>
                <td>POST限制</td>
                <td>Execution超时</td>
                <td>Input超时</td>
                <td>Socket超时</td>
            </tr>
            <tr>
                <td><?=ini_get('memory_limit')?></td>
                <td><?=ini_get('upload_max_filesize')?></td>
                <td><?=ini_get('post_max_size')?></td>
                <td><?=ini_get('max_execution_time').'s'?></td>
                <td><?=ini_get('max_input_time').'s'?></td>
                <td><?=ini_get('default_socket_timeout').'s'?></td>
            </tr>
            <tr>
                <td colspan="6" style="text-align: center; font-weight: bold;">功能组件</td>
            </tr>
            <tr>
                <td>MySQLi</td>
                <td>cURL</td>
                <td>GD library</td>
                <td>EXIF信息查看</td>
                <td>OpenSSL</td>
                <td>Mbstring</td>
            </tr>
            <tr>
                <td><?=get_extension_funcs('mysqli') ? '开启' : '关闭' ?></td>
                <td><?=get_extension_funcs('curl') ? '开启' : '关闭' ?></td>
                <td><?=get_extension_funcs('gd') ? '开启' : '关闭' ?></td>
                <td><?=get_extension_funcs('exif') ? '开启' : '关闭' ?></td>
                <td><?=get_extension_funcs('openssl') ? '开启' : '关闭' ?></td>
                <td><?=get_extension_funcs('mbstring') ? '开启' : '关闭' ?></td>
            </tr>
        </table>
    </div>
</div>

{template '../footer'}   